using System;
using System.IO;
using Data;
using JsonFx.Json;
using TMPro;
using UnityEngine;

public class EditSceneHandler : MonoBehaviour, IGameScene, IHandlerBase
{
	private void Update()
	{
	}

	private void LoadPackage(string mode, string packageName)
	{
		Level[] levels;
		try
		{
			string value = JsonFileSystem.Read(mode + "/" + packageName + "_package");
			levels = JsonReader.Deserialize<Level[]>(value);
		}
		catch (FileNotFoundException message)
		{
			UnityEngine.Debug.Log(message);
			levels = new Level[0];
		}
		this.editPackage = new Package();
		this.editPackage.levels = levels;
		for (int i = 0; i < this.editPackage.levels.Length; i++)
		{
			this.editPackage.levels[i].num = i;
		}
		this.conditions.levelLength = this.editPackage.levels.Length;
	}

	public void DoDataExchange()
	{
	}

	public void OnEnterScene(object param)
	{
		EditLevelConditions editLevelConditions = this.conditions;
		editLevelConditions.OnChangeMode = (Action)Delegate.Combine(editLevelConditions.OnChangeMode, new Action(this.OnClickChangeMode));
		EditLevelConditions editLevelConditions2 = this.conditions;
		editLevelConditions2.OnGeneratorLevel = (Action<int>)Delegate.Combine(editLevelConditions2.OnGeneratorLevel, new Action<int>(this.OnClickGenerator));
		EditLevelConditions editLevelConditions3 = this.conditions;
		editLevelConditions3.OnAddGeneratorLevel = (Action<int>)Delegate.Combine(editLevelConditions3.OnAddGeneratorLevel, new Action<int>(this.OnClickAddGenerator));
		EditLevelConditions editLevelConditions4 = this.conditions;
		editLevelConditions4.OnUpdateLevel = (Action<int>)Delegate.Combine(editLevelConditions4.OnUpdateLevel, new Action<int>(this.OnClickUpdate));
		EditLevelConditions editLevelConditions5 = this.conditions;
		editLevelConditions5.OnLevelLoad = (Action<int>)Delegate.Combine(editLevelConditions5.OnLevelLoad, new Action<int>(this.OnClickLoad));
		EditLevelConditions editLevelConditions6 = this.conditions;
		editLevelConditions6.OnChangeLevel = (Action<int, int>)Delegate.Combine(editLevelConditions6.OnChangeLevel, new Action<int, int>(this.OnClickChange));
		EditLevelConditions editLevelConditions7 = this.conditions;
		editLevelConditions7.OnDeleteLevel = (Action<int>)Delegate.Combine(editLevelConditions7.OnDeleteLevel, new Action<int>(this.OnClickDelete));
		EditLevelConditions editLevelConditions8 = this.conditions;
		editLevelConditions8.OnRandomGeneratorLevel = (Action<int>)Delegate.Combine(editLevelConditions8.OnRandomGeneratorLevel, new Action<int>(this.OnClickRandomGeneratorLevel));
		EditLevelConditions editLevelConditions9 = this.conditions;
		editLevelConditions9.OnRandomAddGeneratorLevel = (Action<int>)Delegate.Combine(editLevelConditions9.OnRandomAddGeneratorLevel, new Action<int>(this.OnClickRandomAddGeneratorLevel));
		EditLevelConditions editLevelConditions10 = this.conditions;
		editLevelConditions10.OnRandomUpdateLevel = (Action<int>)Delegate.Combine(editLevelConditions10.OnRandomUpdateLevel, new Action<int>(this.OnClickRandomUpdateLevel));
		EditLevelConditions editLevelConditions11 = this.conditions;
		editLevelConditions11.OnLoadLevelDraw = (Action<int>)Delegate.Combine(editLevelConditions11.OnLoadLevelDraw, new Action<int>(this.OnClickLoadLevelDraw));
		EditLevelConditions editLevelConditions12 = this.conditions;
		editLevelConditions12.OnLoadRandomDraw = (Action)Delegate.Combine(editLevelConditions12.OnLoadRandomDraw, new Action(this.OnClickLoadRandomDraw));
		EditLevelConditions editLevelConditions13 = this.conditions;
		editLevelConditions13.OnShuppleIndex = (Action<int>)Delegate.Combine(editLevelConditions13.OnShuppleIndex, new Action<int>(this.OnClickShuppleIndex));
		EditLevelConditions editLevelConditions14 = this.conditions;
		editLevelConditions14.OnOverlapCheck = (Action)Delegate.Combine(editLevelConditions14.OnOverlapCheck, new Action(this.OnClickOverlap));
		EditLevelConditions editLevelConditions15 = this.conditions;
		editLevelConditions15.OnPackageOverlapBlockCheck = (Action)Delegate.Combine(editLevelConditions15.OnPackageOverlapBlockCheck, new Action(this.OnClickPackageOverlapBlock));
		EditLevelConditions editLevelConditions16 = this.conditions;
		editLevelConditions16.OnPorting = (Action)Delegate.Combine(editLevelConditions16.OnPorting, new Action(this.OnClickPorting));
		EditLevelConditions editLevelConditions17 = this.conditions;
		editLevelConditions17.OnSetPicture = (Action<int>)Delegate.Combine(editLevelConditions17.OnSetPicture, new Action<int>(this.OnClickSetPicture));
		EditLevelConditions editLevelConditions18 = this.conditions;
		editLevelConditions18.OnDelPicture = (Action<int>)Delegate.Combine(editLevelConditions18.OnDelPicture, new Action<int>(this.OnClickDelPicture));
		EditDrawCtrl editDrawCtrl = this.editDrawCtrl;
		editDrawCtrl.onUpdateTileCount = (Action<string>)Delegate.Combine(editDrawCtrl.onUpdateTileCount, new Action<string>(this.OnUpdateTileCount));
		this.InitMapInfo();
		this.isCustom = !this.isCustom;
		this.OnClickEdit();
	}

	public void OnLeaveScene()
	{
		EditLevelConditions editLevelConditions = this.conditions;
		editLevelConditions.OnGeneratorLevel = (Action<int>)Delegate.Remove(editLevelConditions.OnGeneratorLevel, new Action<int>(this.OnClickGenerator));
		EditLevelConditions editLevelConditions2 = this.conditions;
		editLevelConditions2.OnAddGeneratorLevel = (Action<int>)Delegate.Remove(editLevelConditions2.OnAddGeneratorLevel, new Action<int>(this.OnClickAddGenerator));
		EditLevelConditions editLevelConditions3 = this.conditions;
		editLevelConditions3.OnAddGeneratorLevel = (Action<int>)Delegate.Remove(editLevelConditions3.OnAddGeneratorLevel, new Action<int>(this.OnClickAddGenerator));
		EditLevelConditions editLevelConditions4 = this.conditions;
		editLevelConditions4.OnLevelLoad = (Action<int>)Delegate.Remove(editLevelConditions4.OnLevelLoad, new Action<int>(this.OnClickLoad));
		EditLevelConditions editLevelConditions5 = this.conditions;
		editLevelConditions5.OnChangeLevel = (Action<int, int>)Delegate.Remove(editLevelConditions5.OnChangeLevel, new Action<int, int>(this.OnClickChange));
		EditLevelConditions editLevelConditions6 = this.conditions;
		editLevelConditions6.OnDeleteLevel = (Action<int>)Delegate.Remove(editLevelConditions6.OnDeleteLevel, new Action<int>(this.OnClickDelete));
		EditLevelConditions editLevelConditions7 = this.conditions;
		editLevelConditions7.OnUpdateLevel = (Action<int>)Delegate.Remove(editLevelConditions7.OnUpdateLevel, new Action<int>(this.OnClickUpdate));
		EditLevelConditions editLevelConditions8 = this.conditions;
		editLevelConditions8.OnRandomGeneratorLevel = (Action<int>)Delegate.Remove(editLevelConditions8.OnRandomGeneratorLevel, new Action<int>(this.OnClickRandomGeneratorLevel));
		EditLevelConditions editLevelConditions9 = this.conditions;
		editLevelConditions9.OnRandomAddGeneratorLevel = (Action<int>)Delegate.Remove(editLevelConditions9.OnRandomAddGeneratorLevel, new Action<int>(this.OnClickRandomAddGeneratorLevel));
		EditLevelConditions editLevelConditions10 = this.conditions;
		editLevelConditions10.OnRandomUpdateLevel = (Action<int>)Delegate.Remove(editLevelConditions10.OnRandomUpdateLevel, new Action<int>(this.OnClickRandomUpdateLevel));
		EditLevelConditions editLevelConditions11 = this.conditions;
		editLevelConditions11.OnLoadLevelDraw = (Action<int>)Delegate.Remove(editLevelConditions11.OnLoadLevelDraw, new Action<int>(this.OnClickLoadLevelDraw));
		EditLevelConditions editLevelConditions12 = this.conditions;
		editLevelConditions12.OnLoadRandomDraw = (Action)Delegate.Remove(editLevelConditions12.OnLoadRandomDraw, new Action(this.OnClickLoadRandomDraw));
		EditLevelConditions editLevelConditions13 = this.conditions;
		editLevelConditions13.OnShuppleIndex = (Action<int>)Delegate.Remove(editLevelConditions13.OnShuppleIndex, new Action<int>(this.OnClickShuppleIndex));
		EditLevelConditions editLevelConditions14 = this.conditions;
		editLevelConditions14.OnOverlapCheck = (Action)Delegate.Remove(editLevelConditions14.OnOverlapCheck, new Action(this.OnClickOverlap));
		EditLevelConditions editLevelConditions15 = this.conditions;
		editLevelConditions15.OnPackageOverlapBlockCheck = (Action)Delegate.Remove(editLevelConditions15.OnPackageOverlapBlockCheck, new Action(this.OnClickPackageOverlapBlock));
		EditLevelConditions editLevelConditions16 = this.conditions;
		editLevelConditions16.OnPorting = (Action)Delegate.Remove(editLevelConditions16.OnPorting, new Action(this.OnClickPorting));
		EditLevelConditions editLevelConditions17 = this.conditions;
		editLevelConditions17.OnSetPicture = (Action<int>)Delegate.Remove(editLevelConditions17.OnSetPicture, new Action<int>(this.OnClickSetPicture));
		EditLevelConditions editLevelConditions18 = this.conditions;
		editLevelConditions18.OnDelPicture = (Action<int>)Delegate.Remove(editLevelConditions18.OnDelPicture, new Action<int>(this.OnClickDelPicture));
		EditDrawCtrl editDrawCtrl = this.editDrawCtrl;
		editDrawCtrl.onUpdateTileCount = (Action<string>)Delegate.Remove(editDrawCtrl.onUpdateTileCount, new Action<string>(this.OnUpdateTileCount));
	}

	private void ClickBoardInfo()
	{
		UnityEngine.Debug.Log("ClickBoardInfo");
		this.editDrawCtrl.GetBoard();
		this.editDrawCtrl.DebugBoard();
	}

	private void OnEscape()
	{
		Scene.ChangeTo("IntroScene", null);
	}

	private void LoadLevel()
	{
		if (!this.puzzleCtrl.gameObject.activeSelf)
		{
			return;
		}
		this.InitMapInfo();
		this.puzzleCtrl.LoadLevel(this.level, false, false);
		this.title.text = "Level - " + (this.level.num + 1);
		this.fakeObj.SetActive(this.level.isFake);
		this.blockCount.text = "block : " + this.level.blockcount;
		this.isSolution = false;
	}

	private void InitMapInfo()
	{
		float bannerPositionY = BlockBannerAnchor.GetBannerPositionY();
		this.btnBottom.transform.localPosition = new Vector3(this.btnBottom.transform.localPosition.x, bannerPositionY, this.btnBottom.transform.localPosition.z);
		this.bottom.transform.localPosition = new Vector3(this.bottom.transform.localPosition.x, this.bottomDown.transform.parent.localPosition.y + this.bottomDown.transform.localPosition.y, this.bottom.transform.localPosition.z);
		float y = (this.topDown.transform.localPosition.y + this.bottomUp.transform.parent.localPosition.y + this.bottomUp.transform.localPosition.y) / 2f;
		this.puzzleCtrl.transform.localPosition = new Vector3(this.puzzleCtrl.transform.localPosition.x, y, this.puzzleCtrl.transform.localPosition.z);
		this.editDrawCtrl.transform.localPosition = this.puzzleCtrl.transform.localPosition;
		BlocksCoordinate.coordinate.coordinate.width = ((this.level != null) ? this.level.width : 9);
		BlocksCoordinate.coordinate.coordinate.height = ((this.level != null) ? this.level.height : 6);
		float num = this.topDown.transform.position.y - this.bottomUp.transform.position.y;
		float num2 = 0f;
		if (GameMode.gameMode == GameType.HEXA || GameMode.gameMode == GameType.RHOMBUS)
		{
			num2 = BlocksCoordinate.coordinate.coordinate.SizeY / 2f;
		}
		BlocksCoordinate.coordinate.coordinate.size = BlocksCoordinate.coordinate.defaultCoordinate.size;
		if (BlocksCoordinate.coordinate.coordinate.SizeY * (float)this.level.height + num2 > num)
		{
			BlocksCoordinate.coordinate.coordinate.size = num / (float)this.level.height / (BlocksCoordinate.coordinate.coordinate.SizeY / BlocksCoordinate.coordinate.coordinate.size) - num2 / (float)this.level.height;
		}
		float num3 = (float)this.level.width;
		if (GameMode.gameMode == GameType.TANGRAM)
		{
			num3 += 2f;
		}
		else if (GameMode.gameMode == GameType.TRIANGLE)
		{
			num3 += 1f;
		}
		else if (GameMode.gameMode == GameType.RHOMBUS)
		{
			num3 *= 0.6666667f;
		}
		float num4 = Mathf.Abs(BlockBannerAnchor.GetRightPositionX() - BlockBannerAnchor.GetLeftPositionX());
		if (BlocksCoordinate.coordinate.coordinate.SizeX * num3 > num4)
		{
			BlocksCoordinate.coordinate.coordinate.size = num4 / num3 / (BlocksCoordinate.coordinate.coordinate.SizeX / BlocksCoordinate.coordinate.coordinate.size);
		}
	}

	private void Hint()
	{
		this.puzzleCtrl.UseHint();
	}

	private void Solution()
	{
		this.isSolution = !this.isSolution;
		this.puzzleCtrl.Solution(this.isSolution);
	}

	private void Reflash()
	{
		this.LoadLevel();
	}

	private void ReSet()
	{
		this.editDrawCtrl.ReSet();
	}

	private string GetModeName()
	{
		if (this.conditions.modeName == 0)
		{
			return "square";
		}
		if (this.conditions.modeName == 1)
		{
			return "triangle";
		}
		if (this.conditions.modeName == 2)
		{
			return "hexa";
		}
		if (this.conditions.modeName == 3)
		{
			return "rhombus";
		}
		if (this.conditions.modeName == 4)
		{
			return "tangram";
		}
		if (this.conditions.modeName == 5)
		{
			return "multiple";
		}
		return "square";
	}

	private void OnClickChangeMode()
	{
		this.editDrawCtrl.ReSetBoard();
		if (this.conditions.levelIndex - 1 >= this.editPackage.levels.Length)
		{
			return;
		}
		this.level = this.editPackage.levels[this.conditions.levelIndex - 1];
		this.LoadLevel();
	}

	private void OnClickGenerator(int index)
	{
		int[][] customBoard = null;
		int[][] boardColor = null;
		Point minPoint = new Point(0, 0);
		this.isCustom = (this.conditions.isCustom || this.isCustom);
		if (this.isCustom)
		{
			customBoard = this.editDrawCtrl.GetBoard();
			boardColor = this.editDrawCtrl.GetBoardColor();
			minPoint = this.editDrawCtrl.GetMinPoint();
		}
		this.generator.GeneratorLevel(this.GetModeName(), this.conditions.packageName, this.conditions.pictureTheme, this.conditions.pictureName, this.conditions.levelCount, this.conditions.widthMin, this.conditions.widthMax, this.conditions.heightMin, this.conditions.heightMax, this.conditions.minBlockTile, this.conditions.maxBlockTile, this.conditions.blockCount, this.conditions.overlapBlockCount, this.conditions.isDouble, this.conditions.isRotate, this.conditions.isFake, this.conditions.fakeCount, this.isCustom, customBoard, this.editDrawCtrl.IsReverse(), minPoint, boardColor, false, -1);
		this.LoadPackage(this.GetModeName(), this.conditions.packageName);
		this.level = this.editPackage.levels[index];
		this.isCustom = true;
		this.OnClickEdit();
		this.LoadLevel();
	}

	private void OnClickAddGenerator(int index)
	{
		int[][] customBoard = null;
		int[][] boardColor = null;
		Point minPoint = new Point(0, 0);
		this.isCustom = (this.conditions.isCustom || this.isCustom);
		if (this.isCustom)
		{
			customBoard = this.editDrawCtrl.GetBoard();
			boardColor = this.editDrawCtrl.GetBoardColor();
			minPoint = this.editDrawCtrl.GetMinPoint();
		}
		this.generator.GeneratorLevel(this.GetModeName(), this.conditions.packageName, this.conditions.pictureTheme, this.conditions.pictureName, this.conditions.levelCount, this.conditions.widthMin, this.conditions.widthMax, this.conditions.heightMin, this.conditions.heightMax, this.conditions.minBlockTile, this.conditions.maxBlockTile, this.conditions.blockCount, this.conditions.overlapBlockCount, this.conditions.isDouble, this.conditions.isRotate, this.conditions.isFake, this.conditions.fakeCount, this.isCustom, customBoard, this.editDrawCtrl.IsReverse(), minPoint, boardColor, false, index - 1);
		this.LoadPackage(this.GetModeName(), this.conditions.packageName);
		this.level = this.editPackage.levels[index - 1];
		this.isCustom = true;
		this.OnClickEdit();
		this.LoadLevel();
	}

	private void OnClickUpdate(int index)
	{
		int[][] customBoard = null;
		int[][] boardColor = null;
		Point minPoint = new Point(0, 0);
		this.isCustom = (this.conditions.isCustom || this.isCustom);
		if (this.isCustom)
		{
			customBoard = this.editDrawCtrl.GetBoard();
			boardColor = this.editDrawCtrl.GetBoardColor();
			minPoint = this.editDrawCtrl.GetMinPoint();
		}
		this.generator.GeneratorLevel(this.GetModeName(), this.conditions.packageName, this.conditions.pictureTheme, this.conditions.pictureName, this.conditions.levelCount, this.conditions.widthMin, this.conditions.widthMax, this.conditions.heightMin, this.conditions.heightMax, this.conditions.minBlockTile, this.conditions.maxBlockTile, this.conditions.blockCount, this.conditions.overlapBlockCount, this.conditions.isDouble, this.conditions.isRotate, this.conditions.isFake, this.conditions.fakeCount, this.isCustom, customBoard, this.editDrawCtrl.IsReverse(), minPoint, boardColor, true, index - 1);
		this.LoadPackage(this.GetModeName(), this.conditions.packageName);
		this.level = this.editPackage.levels[index - 1];
		this.isCustom = true;
		this.OnClickEdit();
		this.LoadLevel();
	}

	private void OnClickRandomGeneratorLevel(int index)
	{
		this.generator.RandomGeneratorLevel(this.GetModeName(), this.conditions.packageName, this.conditions.pictureTheme, this.conditions.pictureName, this.conditions.levelCount, this.conditions.minBlockTile, this.conditions.maxBlockTile, this.conditions.blockCount, this.conditions.isFake, this.conditions.fakeCount, this.conditions.overlapBlockCount, false, -1);
		this.LoadPackage(this.GetModeName(), this.conditions.packageName);
		this.level = this.editPackage.levels[index];
		this.isCustom = true;
		this.OnClickEdit();
		this.LoadLevel();
	}

	private void OnClickRandomAddGeneratorLevel(int index)
	{
		this.generator.RandomGeneratorLevel(this.GetModeName(), this.conditions.packageName, this.conditions.pictureTheme, this.conditions.pictureName, this.conditions.levelCount, this.conditions.minBlockTile, this.conditions.maxBlockTile, this.conditions.blockCount, this.conditions.isFake, this.conditions.fakeCount, this.conditions.overlapBlockCount, false, index - 1);
		this.LoadPackage(this.GetModeName(), this.conditions.packageName);
		this.level = this.editPackage.levels[index - 1];
		this.isCustom = true;
		this.OnClickEdit();
		this.LoadLevel();
	}

	private void OnClickRandomUpdateLevel(int index)
	{
		this.generator.RandomGeneratorLevel(this.GetModeName(), this.conditions.packageName, this.conditions.pictureTheme, this.conditions.pictureName, this.conditions.levelCount, this.conditions.minBlockTile, this.conditions.maxBlockTile, this.conditions.blockCount, this.conditions.isFake, this.conditions.fakeCount, this.conditions.overlapBlockCount, true, index - 1);
		this.LoadPackage(this.GetModeName(), this.conditions.packageName);
		this.level = this.editPackage.levels[index - 1];
		this.isCustom = true;
		this.OnClickEdit();
		this.LoadLevel();
	}

	private void OnClickLoadLevelDraw(int index)
	{
		Level level = this.editPackage.levels[index - 1];
		this.conditions.blockCount = level.blockcount;
		this.conditions.isFake = level.isFake;
		if (this.conditions.isFake)
		{
			this.conditions.fakeCount = level.level.GetLength(0) - this.conditions.blockCount;
		}
		this.editDrawCtrl.LoadLevelDraw(level);
		this.level = this.editPackage.levels[index - 1];
		this.isCustom = true;
		this.OnClickEdit();
		this.LoadLevel();
		this.OnClickEdit();
	}

	private void OnClickLoadRandomDraw()
	{
		this.editDrawCtrl.SetRandomBoard(this.conditions.minBlockTile, this.conditions.maxBlockTile, this.conditions.blockCount);
	}

	private void OnClickLoad(int index)
	{
		if (index - 1 >= this.editPackage.levels.Length)
		{
			return;
		}
		this.level = this.editPackage.levels[index - 1];
		this.conditions.gameType = (GameType)this.level.mode;
		GameMode.gameMode = this.conditions.gameType;
		if (GameMode.gameMode == GameType.TRIANGLE)
		{
			BlocksCoordinate.coordinate = new BlockTriangleCoordinate();
		}
		else if (GameMode.gameMode == GameType.SQUARE)
		{
			BlocksCoordinate.coordinate = new BlockSquareCoordinate();
		}
		else if (GameMode.gameMode == GameType.HEXA)
		{
			BlocksCoordinate.coordinate = new BlockHexaCoordinate();
		}
		else if (GameMode.gameMode == GameType.RHOMBUS)
		{
			BlocksCoordinate.coordinate = new BlockRhombusCoordinate();
		}
		else if (GameMode.gameMode == GameType.TANGRAM)
		{
			BlocksCoordinate.coordinate = new BlockTangramCoordinate();
		}
		this.conditions.pictureTheme = this.level.pictureTheme;
		this.conditions.pictureName = this.level.pictureName;
		this.LoadLevel();
	}

	private void OnClickChange(int index1, int index2)
	{
		this.generator.ChangeLevel(this.GetModeName(), this.conditions.packageName, index1 - 1, index2 - 1);
		this.LoadPackage(this.GetModeName(), this.conditions.packageName);
		this.level = this.editPackage.levels[index1 - 1];
		this.LoadLevel();
	}

	private void OnClickDelete(int index)
	{
		this.generator.Delete(this.conditions.packageName, index - 1);
		this.LoadPackage(this.GetModeName(), this.conditions.packageName);
		if (this.editPackage.levels.Length - 1 < index - 1)
		{
			this.level = this.editPackage.levels[index - 2];
		}
		else
		{
			this.level = this.editPackage.levels[index - 1];
		}
		this.LoadLevel();
	}

	private void OnClickShuppleIndex(int index)
	{
		this.generator.ShuppleIndex(this.GetModeName(), this.conditions.packageName, index - 1);
		this.LoadPackage(this.GetModeName(), this.conditions.packageName);
		this.level = this.editPackage.levels[index - 1];
		this.LoadLevel();
	}

	private void OnClickOverlap()
	{
		this.generator.Overlap(this.conditions.packageName);
	}

	private void OnClickPackageOverlapBlock()
	{
		this.generator.PackageOverlapBlock(this.conditions.packageName, this.conditions.overlapBlockCount);
	}

	private void OnClickEdit()
	{
		this.isCustom = !this.isCustom;
		this.customCheck.SetActive(this.isCustom);
		this.puzzleCtrl.gameObject.SetActive(!this.isCustom);
		this.editDrawCtrl.gameObject.SetActive(this.isCustom);
	}

	private void OnUpdateTileCount(string tileCount)
	{
		this.currentTileCount.text = tileCount;
	}

	private void OnClickPorting()
	{
		this.generator.Porting(this.conditions.portingPackage, this.conditions.porting);
	}

	private void OnClickSetPicture(int index)
	{
		this.generator.SetPicture(this.GetModeName(), this.conditions.packageName, index - 1, this.conditions.pictureTheme, this.conditions.pictureName);
		this.LoadPackage(this.GetModeName(), this.conditions.packageName);
		this.level = this.editPackage.levels[index - 1];
		this.isCustom = true;
		this.LoadLevel();
	}

	private void OnClickDelPicture(int index)
	{
		this.generator.DelPicture(this.GetModeName(), this.conditions.packageName, index - 1);
		this.LoadPackage(this.GetModeName(), this.conditions.packageName);
		this.level = this.editPackage.levels[index - 1];
		this.isCustom = true;
		this.LoadLevel();
	}

	[SerializeField]
	private Camera cam;

	[SerializeField]
	private GameObject curtain;

	private EditGenerator generator = new EditGenerator();

	public TextMeshPro title;

	public TextMeshPro currentTileCount;

	public PuzzleCtrl puzzleCtrl;

	public EditDrawCtrl editDrawCtrl;

	public EditLevelConditions conditions;

	public GameObject fakeObj;

	public TextMeshPro blockCount;

	public GameObject topDown;

	public GameObject bottom;

	public GameObject bottomUp;

	public GameObject bottomDown;

	public GameObject btnBottom;

	private Package editPackage;

	private Level level;

	private float time;

	private bool isCustom;

	public GameObject customCheck;

	private bool isSolution;
}
